// 创建实例 i18n
import { createI18n } from "vue-i18n";
import { getStorage } from "../../utils/localStorage"
import zh from "./zh.json";
import en from "./en.json";



// 直接从本地读取 或 从store
const locale = getStorage("lang");
const i18n = createI18n({
    locale:locale?.lang || "zh",
    legacy:false,
    // fallbackLocale:"en",
    globalInjection:true,
    messages: {
        en,
        zh, 
      }
});
export default i18n;